﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Calculation
{
    public class CalculationProgress
    {
        private double currentResult;
        private ulong samples;

        public delegate void ProgressChangedHandler(CalculationProgress progress);

        public event ProgressChangedHandler ProgressChanged = delegate {};

        public double CurrentResult 
        {
            get { return currentResult; }
        }

        public ulong Samples
        {
            get { return samples; }
        }

        public void SetCurrentResult(double result, ulong samples)
        {
            this.currentResult = result;
            this.samples = samples;
            ProgressChanged(this);
        }

        public bool CancellationPending { get; set; }
    }
}
